<template>
  <div class="material-detail container-public">
    <div class="page-head">
      <Head></Head>
      <Mallhead></Mallhead>
    </div>
    <div class="material-detail-con">
      <div class="detail-public">
        <div class="detail-left">
          <b class="title">{{brandInfo.title}}</b>
          <div class="price-transaction">
            <div class="price">
              <b>价格：</b>
              <span class="blue">
                {{brandInfo.unitPrice}}
                <p class="black">元/个</p>
              </span>
            </div>
            <div class="price transaction">
              <b>可交易量：</b>
              <span class="blue">
                {{brandInfo.tradableTotal}}
                <p class="black">个</p>
              </span>
            </div>
          </div>
          <div class="list">
            <div class="item">
              <b>大类：</b>
              <span>{{brandInfo.bigCategory}}</span>
            </div>
            <div class="item">
              <b>类目：</b>
              <span>{{brandInfo.category}}</span>
            </div>
            <div class="item">
              <b>材质：</b>
              <span>{{brandInfo.texture}}</span>
            </div>
            <div class="item">
              <b>产地：</b>
              <span>{{brandInfo.producingArea}}</span>
            </div>
          </div>
        </div>
        <div class="detail-right">
          <div class="avt">
            <i class="iconfont">&#xe629;</i>
            <span>{{brandInfo.expirationName}}</span>
          </div>
          <span>联系人：{{brandInfo.linkMan}}</span>
          <span>联系电话：{{brandInfo.phone}}</span>
          <span>身份：{{typeOptions[brandInfo.type]}}交易商</span>
        </div>
      </div>
      <div class="detail-img">
        <div class="title">
          <b class="label">简述：</b>
          <span class="remark">{{brandInfo.remark}}</span>
        </div>
        <div class="img" v-for="(url, index) in brandInfo.goodsPicArray" :key="index">
          <el-image :src="url" fit="contain" style="width: 100%"></el-image>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { intBrandInfo } from "@/api/mall/Brand";
export default {
  name: "MaterialsDetail",
  data() {
    return {
      typeOptions: {
        '0': '普通',
        '1': '企业',
        '2': '个人'
      },
      brandInfo: {}
    };
  },
  mounted() {
    this._intBrandInfo()
  },
  methods: {
    // 获取品牌中心细信息
    async _intBrandInfo() {
      if (!this.$route.params.id) return
      const res = await intBrandInfo(this.$route.params.id)
      if (res.code === 200) {
        this.brandInfo = res.data
      }
    },
  },
};
</script>
<style scoped lang="scss">
@import "@/style/color.scss";
.material-detail-con {
  width: $bigWidth;
  background-color: #fff;
  margin: 0 auto;
  .detail-public {
    background: #fff;
    padding: 0 20px 20px 70px;
    display: flex;
    .detail-left {
      width: 60%;
      border-right: 3px dashed #606266;
      box-sizing: border-box;
      padding-right: 20px;
      .title {
        font-size: 20px;
      }
      .price-transaction {
        margin-top: 40px;
        display: flex;
        .price {
          display: flex;
          align-items: center;
          b {
            font-size: 16px;
          }
          .blue {
            margin-left: 10px;
            font-size: 30px;
            color: $blueColor;
            font-weight: bolders;
          }
          .black {
            display: inline-block;
            color: #606266;
            font-size: 14px;
          }
          .btn {
            padding: 4px 6px;
            color: $blueColor;
            border: 1px solid $blueColor;
            margin-left: 15px;
            cursor: pointer;
          }
        }
        .transaction {
          margin-left: 50px;
        }
      }
      .list {
        margin-top: 40px;
        display: flex;
        flex-wrap: wrap;
        .item {
          width: 33.33%;
          margin-bottom: 30px;
          span {
            color: $blackColor;
          }
        }
      }
    }
    .detail-right {
      padding-left: 50px;
      width: 40%;
      color: $blackColor;
      span {
        margin-top: 20px;
        display: block;
      }
      .avt {
        display: flex;
        align-items: center;
        margin-top: 20px;

        i {
          font-size: 40px;
          margin-right: 30px;
        }
        span {
          margin-top: 0;
        }
      }
    }
  }
  .detail-img {
    margin-top: 10px;
    background: #fff;
    padding: 50px;
    .title {
      display: flex;
      align-items: center;
      .label {
        font-size: 20px;
        margin-right: 50px;
        flex-shrink: 0;
      }
      .remark {
        line-height: 20px;
      }
    }
    .img {
      width: 50%;
      margin: 20px auto 0;
    }
  }
}
</style>
